﻿using System;
using MyWeb.Business;

public partial class slide : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        Response.ContentType = "text/xml";

        var list = AdvertiseService.Advertise_GetByTop("", " Active = '1' and Position = '4' ", "");
        if (list.Count > 0)
        {
            var chuoi = "";
            chuoi += "<?xml version='1.0' encoding='utf-8'?>\n";
            chuoi += "<flash_parameters copyright=\"socusoftFSMTheme\">\n";
            chuoi += "<preferences>\n";
            chuoi += "<global>\n";
            chuoi += "<basic_property movieWidth=\"728\" movieHeight=\"198\" startAutoPlay=\"true\" backgroundColor=\"\" decoration=\"images/jumping_line_1.swf\" continuum=\"true\" html_title=\"Title\" loadStyle=\"Bar\" socusoftMenu=\"false\" hideAdobeMenu=\"false\" photoDynamicShow=\"false\" enableURL=\"true\" transitionArray=\"1,2,3\"/>\n";
            chuoi += "<title_property photoTitle=\"false\" photoTitleX=\"10\" photoTitleY=\"170\" photoTitleSize=\"22\" photoTitleFont=\"Tahoma\" photoTitleColor=\"0xffffff\"/>\n";
            chuoi += "<music_property path=\"\" stream=\"true\" loop=\"true\"/>\n";
            chuoi += "<photo_property topPadding=\"0\" bottomPadding=\"0\" leftPadding=\"0\" rightPadding=\"0\"/>\n";
            chuoi += "<properties enable=\"true\" backgroundColor=\"0xffffff\" backgroundAlpha=\"30\" cssText=\"a:link{text-decoration: underline;} a:hover{color:#ff0000; text-decoration: none;} a:active{color:#0000ff;text-decoration: none;} .blue {color:#0000ff; font-size:15px; font-style:italic; text-decoration: underline;} .body{color:#ff5500;font-size:20px;}\" align=\"top\"/>\n";
            chuoi += "</global>\n";
            chuoi += "<control>\n";
            chuoi += "<basic_property showControl=\"false\" showControlX=\"-30\" showControlY=\"460\" showPreviousButton=\"res/previous01.gif\" showPreviousButtonX=\"50\" showStopButton=\"res/stop01.gif\" showStopButtonX=\"97\" showPlayButton=\"res/play01.gif\" showPlayButtonX=\"97\" showNextButton=\"res/next01.gif\" showNextButtonX=\"124\" showSoundButtonX=\"182\"/>\n";
            chuoi += "</control>\n";
            chuoi += "</preferences>\n";
            chuoi += "<album>\n";
            foreach (var t in list)
            {
                if (t.Target == "_blank")
                {
                    chuoi += "<slide jpegURL=\"" + t.Images + "\" d_URL=\"" + t.Images + "\" transition=\"29\" panzoom=\"1\" URLTarget=\"0\" url=\"" + t.Link + "\" phototime=\"2\" width=\"" + t.Width + "\" height=\"" + t.Height + "\"/>";
                }
                else
                {
                    chuoi += "<slide jpegURL=\"" + t.Images + "\" d_URL=\"" + t.Images + "\" transition=\"29\" panzoom=\"1\" URLTarget=\"1\" url=\"" + t.Link + "\" phototime=\"2\" width=\"" + t.Width + "\" height=\"" + t.Height + "\"/>";
                }
            }
            chuoi += "</album>\n";
            chuoi += "</flash_parameters>\n";
            Response.ContentType = "text/xml";
            Response.Write(chuoi);
        }
    }
    
}